﻿<Window x:Class="WPFSortableCollectionTest.Window1"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Window1" Height="300" Width="300"
        x:Name="MainWindow">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <ListView x:Name="lstTest"
                  ItemsSource="{Binding ElementName=MainWindow, Path=People}"
                  VirtualizingStackPanel.IsVirtualizing="True">
            <ListView.View>
                <GridView>
                    <GridViewColumn DisplayMemberBinding="{Binding FirstName}"
                                    Header="First Name">
                        <GridViewColumn.HeaderTemplate>
                            <DataTemplate>
                                <Button Content="{Binding}"
                                        Click="Sort_Click"/>
                            </DataTemplate>
                        </GridViewColumn.HeaderTemplate>
                    </GridViewColumn>
                    <GridViewColumn DisplayMemberBinding="{Binding LastName}"
                                    Header="Last Name">
                        <GridViewColumn.HeaderTemplate>
                            <DataTemplate>
                                <Button Content="{Binding}"
                                        Click="Sort_Click"/>
                            </DataTemplate>
                        </GridViewColumn.HeaderTemplate>
                    </GridViewColumn>
                </GridView>
            </ListView.View>
            <ListView.ItemsPanel>
                <ItemsPanelTemplate>
                    <VirtualizingStackPanel IsItemsHost="True"/>
                </ItemsPanelTemplate>
            </ListView.ItemsPanel>
            <!--<ListView.ItemTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="{Binding FirstName}"/>
                        <TextBlock Text="{Binding LastName}"
                                   Margin="10,0,0,0"/>
                        <TextBlock Text="{Binding AddressHost.Street1}"
                                   Margin="10,0,0,0"/>
                    </StackPanel>
                </DataTemplate>
            </ListView.ItemTemplate>-->
        </ListView>
    </Grid>
</Window>
